<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>北京每小时空气质量柱状图</title>
    <script src="../static/echarts.min.js"></script>
</head>
<body>
<div id="main" style="width:800px;height:400px"></div>
<script type="text/javascript">
      // 基于准备好的dom，初始化echarts实例
      var myChart = echarts.init(document.getElementById('main'));

      var timestamp = [{% for item in timestamp %}{{ item }},{% endfor %}];
      var pm = [{% for item in pm %}{{ item }},{% endfor %}];

      option = {
          title: {
          text: '北京每小时空气质量柱状图'
          },
          xAxis: {
            type: 'category',
            data: timestamp,
            axisLabel:{
                interval:0
                //rotate:40
            }
          },
          tooltip: {},
          legend: {
          data: ['PM']
          },
          yAxis: {
            type: 'value'
          },
          series: [
            {
              name: 'PM',
              data: pm,
              type: 'bar'
            }
          ]
        };

      myChart.setOption(option);



</script>

</body>
</html>